package com.tianhui.consignortwofei.mvp.model;

import android.content.Context;

import com.fgs.common.CommonModel;
import com.fgs.common.api.CommonConfig;
import com.fgs.common.api.CommonConfigTwo;
import com.fgs.common.progress.ObserverResponseListener;
import com.tianhui.consignortwofei.api.DriverApiService;
import com.tianhui.consignortwofei.api.OrderApiService;
import com.tianhui.consignortwofei.mvp.model.enty.DriverInfo;
import com.tianhui.consignortwofei.mvp.model.enty.bankCard.BankCardInfo;
import com.tianhui.consignortwofei.mvp.model.hetong.HuiKuanListBean;

import java.util.Map;

import io.reactivex.ObservableTransformer;

/**
 * @author fgs
 * @date 2020/12/24
 * @description
 **/
public class DriverModel<T> extends CommonModel<T> implements IDictionaryModel<T>{
    /**
     * 司机列表
     *
     * @param context
     * @param map
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void driverListModel(Context context, Map<String, String> map, boolean isDialog,
                                ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(DriverApiService.class).driverList(map), observerListener, transformer, isDialog, true);
    }


    /**
     * 修改手机号
     *
     * @param context
     * @param map
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void changeDriverPhone(Context context, Map<String, String> map, boolean isDialog,
                                ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(DriverApiService.class).changeDriverPhone(map), observerListener, transformer, isDialog, true);
    }

    /**
     * 删除司机
     *
     * @param context
     * @param map
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void deleteDriver(Context context, Map<String, String> map, boolean isDialog,
                                  ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(DriverApiService.class).deleteDriver(map), observerListener, transformer, isDialog, true);
    }



    /**
     * 指派司机列表
     *
     * @param context
     * @param map
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void assignDriverListModel(Context context, Map<String, String> map, boolean isDialog,
                                ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(DriverApiService.class).assignDriverList(map), observerListener, transformer, isDialog, true);
    }

    /**
     * 司机信息
     *
     * @param context
     * @param map
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void driverInfoModel(Context context, Map<String, String> map, boolean isDialog,
                                ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(DriverApiService.class).driverInfo(map), observerListener, transformer, isDialog, true);
    }

    /**
     * 司机信息保存
     *
     * @param context
     * @param info
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void driverInfoSaveModel(Context context, DriverInfo info, boolean isDialog,
                                    ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(DriverApiService.class).driverInfoSave(info), observerListener, transformer, isDialog, true);
    }
    /**
     * 司机审核
     *
     * @param context
     * @param map
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void driverAuditModel(Context context, Map<String, String> map, boolean isDialog,
                                    ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(DriverApiService.class).driverAudit(map), observerListener, transformer, isDialog, true);
    }

    /**
     * 司机信息保存并审核通过
     *
     * @param context
     * @param info
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void driverInfoSaveAndAuditModel(Context context, DriverInfo info, boolean isDialog,
                                    ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(DriverApiService.class).driverInfoSaveAndAudit(info), observerListener, transformer, isDialog, true);
    }

    /**
     * 司机银行卡信息
     *
     * @param context
     * @param map
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void bankCardInfoModel(Context context, Map<String, String> map, boolean isDialog,
                                 ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(DriverApiService.class).driverBankCardInfo(map), observerListener, transformer, isDialog, true);
    }
    /**
     * 编辑司机银行卡信息
     *
     * @param context
     * @param info
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void bankCardInfoUpdateModel(Context context, BankCardInfo info, boolean isDialog,
                                        ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(DriverApiService.class).bankCardInfoUpdate(info), observerListener, transformer, isDialog, true);
    }
    @Override
    public void dictionaryModel(Context context, Map<String, String> map, boolean isDialog, ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {
        subscribe(context, CommonConfig.getInstance().create(OrderApiService.class).dictionaryList(map), observerListener, transformer, isDialog, true);

    }

    /**
     * 解绑司机
     *
     * @param context
     * @param map
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void driverUnbindModel(Context context, Map<String, String> map, boolean isDialog,
                                  ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(DriverApiService.class).driverUnbind(map), observerListener, transformer, isDialog, true);
    }

    /**
     * 绑定司机
     *
     * @param context
     * @param map
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void driverBindModel(Context context, Map<String, String> map, boolean isDialog,
                                ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(DriverApiService.class).driverBind(map), observerListener, transformer, isDialog, true);
    }

    /**
     * 默认司机
     *
     * @param context
     * @param map
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void defaultDriverModel(Context context, Map<String, String> map, boolean isDialog,
                                   ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(DriverApiService.class).defaultDriver(map), observerListener, transformer, isDialog, true);
    }


    /**
     * 获取找车发单列表
     *
     * @param context
     * @param map
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void getSearchCarList(Context context, Map<String, String> map, boolean isDialog,
                                      ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {


        subscribe(context, CommonConfigTwo.getInstance().create(DriverApiService.class).getSearchCarList(map), observerListener, transformer, isDialog, true);
    }




    /**
     * 获取报价列表
     *
     * @param context
     * @param map
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void getQuotationList(Context context, Map<String, String> map, boolean isDialog,
                                      ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(DriverApiService.class).getQuotationList(map), observerListener, transformer, isDialog, true);
    }

    /**
     * 司机信息保存
     *
     * @param context
     * @param info
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void requestQuotationSave(Context context, QuotationListBean.QuotationRecords info, boolean isDialog,
                                    ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(DriverApiService.class).requestQuotationSave(info), observerListener, transformer, isDialog, true);
    }



    /**
     * 获取上次报价
     *
     * @param context
     * @param map
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void getLastBaoJia(Context context, Map<String, String> map, boolean isDialog,
                                 ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(DriverApiService.class).getLastBaoJia(map), observerListener, transformer, isDialog, true);
    }


    /**
     * 删除报价
     *
     * @param context
     * @param map
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void deleteQuotation(Context context, Map<String, String> map, boolean isDialog,
                              ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(DriverApiService.class).deleteQuotation(map), observerListener, transformer, isDialog, true);
    }



    /**
     * 只看报价列表
     *
     * @param context
     * @param map
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void getOnlyLookQuotatList(Context context, Map<String, String> map, boolean isDialog,
                                 ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(DriverApiService.class).getOnlyLookQuotatList(map), observerListener, transformer, isDialog, true);
    }


    /**
     * 只看报价列表
     *
     * @param context
     * @param map
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void getOnlyLookNewList(Context context, Map<String, String> map, boolean isDialog,
                                      ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(DriverApiService.class).getOnlyLookNewList(map), observerListener, transformer, isDialog, true);
    }



    /**
     * 只看报价列表
     *
     * @param context
     * @param map
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void getBaoJiaWeb(Context context, Map<String, String> map, boolean isDialog,
                                      ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(DriverApiService.class).getBaoJiaWeb(map), observerListener, transformer, isDialog, true);
    }



    /**
     * 只看报价列表
     *
     * @param context
     * @param map
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void shenHeTongJi(Context context, Map<String, String> map, boolean isDialog,
                                   ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(DriverApiService.class).shenHeTongJi(map), observerListener, transformer, isDialog, true);
    }




    /**
     * 附件合同未添加列表
     *
     * @param context
     * @param map
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void getUnFuJianList(Context context, Map<String, String> map, boolean isDialog,
                                 ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {


        subscribe(context, CommonConfigTwo.getInstance().create(DriverApiService.class).getUnFuJianList(map), observerListener, transformer, isDialog, true);
    }







    /**
     * 保存未上传附件原因
     *
     * @param context
     * @param info
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void sendFuJianYuan(Context context, SendFuJianYuanBean info, boolean isDialog,
                                     ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfigTwo.getInstance().create(DriverApiService.class).sendFuJianYuan(info), observerListener, transformer, isDialog, true);
    }



    /**
     * 新增换抬头
     *
     * @param context
     * @param info
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void addTaiTouNew(Context context, AddTaiTouBean info, boolean isDialog,
                               ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(DriverApiService.class).addTaiTouNew(info), observerListener, transformer, isDialog, true);
    }



    /**
     * 保存未回款原因
     *
     * @param context
     * @param info
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void sendHuiKuanYuan(Context context, HuiKuanListBean.RecordsDTO info, boolean isDialog,
                                ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(DriverApiService.class).sendHuiKuanYuan(info), observerListener, transformer, isDialog, true);
    }



    /**
     * 附件合同未回款列表
     *
     * @param context
     * @param map
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void getUnHuiKuanList(Context context, Map<String, String> map, boolean isDialog,
                                ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {


        subscribe(context, CommonConfig.getInstance().create(DriverApiService.class).getUnHuiKuanList(map), observerListener, transformer, isDialog, true);
    }










}
